package com.itheima.annotation;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import
   org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class AnnotationAssembleTest {
	public static void main(String[] args) {
		 //定义配置文件路径
		String xmlPath = "src/main/java/com/itheima/annotation/beans7.xml";
		// 加载配置文件
		ApplicationContext applicationContext =
				new FileSystemXmlApplicationContext(xmlPath);
		//ApplicationContext applicationContext = new AnnotationConfigApplicationContext(AnnotationAssembleTest.class);
		// 获取UserController实例
		UserController userController = 
		  (UserController) applicationContext.getBean("userController");
		// 调用UserController中的save()方法
		userController.say();
	}
}  
